|
|
|
|
|
|
|
Figure 11.5
A scaled and rotated spiral, Bowditch curve, and cycloid. |
|
|
|
|
|
|
|
|
Many applications must represent a series of data points as a curve. The following sections discuss several different ways you can fit curves to data points. These methods provide different tradeoffs between a close fit to the data and a smooth curve. |
|
|
|
|
|
|
|
|
On one extreme, you can connect each point to the next with a straight line, as shown in Figure 11.6. This makes the curve fit the data exactly. The curve is not very smooth, however, and it bends sharply at each of the data points. It does a poor job of showing the overall trends in the data. |
|
|
|
|
|
|
|
|
At the other extreme, you can fit the data points with a single straight line, as shown in Figure 11.7. This makes the curve very smooth. The curve never bends or changes direction at all, so in some sense, it is perfectly smooth. It does a good job of showing the data's overall trend, but it may not fit the data very closely. |
|
|
|
|
|
|
|
|
Other methods for fitting curves to data provide solutions that lie somewhere between these two extremes. They tend to follow the data, but not too exactly. As a result, they provide a reasonably smooth curve such as the one in Figure 11.8. |
|
|
|
|
|
|
|
|
Figure 11.6
Fitting data points with line segments matches
the data closely but is not smooth. |
|
|
|
|
|